Fire events that update state during the test are wrapped in act(...)#222
Fire events that update state during the test are wrapped in act(...)#222safarcik wants to merge 1 commit intopatternfly:v5from
Conversation
…(...) When testing, code that causes React state updates should be wrapped into act(...) This ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act
|
This PR should fix this error during the tests: |
wise-king-sullyman
left a comment
There was a problem hiding this comment.
Hello and thank you for putting up this PR!
I don't think act is the route we really want to go here though, as RTL actually uses it internally and discourages its explicit use whenever possible.
Please see this documentation we have about preferred approaches to handling async issues in RTL based tests , if you have already tried our more preferred approaches and none of them resolve the issues please let me know as it may be that we need to update our documentation and guidance here.
I agree with @wise-king-sullyman. From what I can see, the only possible necessary use-case for |
When testing, code that causes React state updates should be wrapped into act(...) This ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act